AsParallel(TSource) Method (IEnumerable(TSource))

Task Parallel System.Threading

Enables parallelization of a query.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function AsParallel(Of TSource) ( _
	source As IEnumerable(Of TSource) _
) As ParallelQuery(Of TSource)
C#
public static ParallelQuery<TSource> AsParallel<TSource>(
	IEnumerable<TSource> source
)

Parameters

source
Type: System.Collections.Generic..::.IEnumerable<(Of <(TSource>)>)
An IEnumerable<(Of <(T>)>) to convert to a ParallelQuery<(Of <(TSource>)>).

Type Parameters

TSource
The type of elements of source.

Return Value

The source as a ParallelQuery<(Of <(TSource>)>) to bind to ParallelEnumerable extension methods.

Exceptions

ExceptionCondition
System..::.ArgumentNullException source is a null reference (Nothing in Visual Basic).

See Also